package cn.bugstack.xfg.dev.tech.config;

import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    private final Counter apiCallCounter;

    public UserController(MeterRegistry registry) {
        apiCallCounter = Counter.builder("myapp.api.calls.total.longyunqi")
                .description("Total API calls")
                .tag("api", "users")
                .register(registry);
    }

    @GetMapping("/api/users")
    public String getUsers() {

      //  çç mimeHeaderField = new MimeHeaderField();
        apiCallCounter.increment();
        // 业务逻辑...

        return "success";
    }
}